/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package linkeddata.arida.ufc.br.manager.impl;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.json.simple.parser.ContainerFactory;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

/**
 *
 * @author jeovane
 */
public class BuildsMapJson {

    public static Map JSONMap(String jsonText) {
        JSONParser parser = new JSONParser();
        ContainerFactory containerFactory = new ContainerFactory() {
            public Map createObjectContainer() {
                return new LinkedHashMap();
            }

            public List creatArrayContainer() {
                return new LinkedList();
            }
        };
        
        Map jsonMap = null;
        try {
            jsonMap = (Map) parser.parse(jsonText, containerFactory);
        } catch (ParseException ex) {
            System.out.println(ex);
        }
        
        return jsonMap;
    }
}
